﻿<!--
   Copyright (c) 2011, Microsoft Corporation
  
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
  
       http://www.apache.org/licenses/LICENSE-2.0
  
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="Microsoft.ServiceBus.Samples.SimpleSilverlightSample.MainPage"
    mc:Ignorable="d"
    d:DesignHeight="640" d:DesignWidth="640">

    <Border x:Name="LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="Steps">
                <VisualState x:Name="Step1">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="ServiceNamespace">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="IssuerSecret">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="GetTokenButton">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step1GetToken" d:IsOptimized="True"/>
                        <ColorAnimation Duration="0" To="#FF3399FF" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock" d:IsOptimized="True"/>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Step2">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="NewQueueName">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="CreateQueueButton">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step2CreateQueue" d:IsOptimized="True"/>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step1GetToken" d:IsOptimized="True"/>
                        <ColorAnimation Duration="0" To="#FF3399FF" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock1" d:IsOptimized="True"/>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Step3">
                    <Storyboard>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step1GetToken" d:IsOptimized="True"/>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step2CreateQueue" d:IsOptimized="True"/>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step3SendMessage" d:IsOptimized="True"/>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="MessageToSend">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="SendMessageButton">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ColorAnimation Duration="0" To="#FF3399FF" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock2" d:IsOptimized="True"/>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Step4">
                    <Storyboard>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step1GetToken" d:IsOptimized="True"/>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step2CreateQueue" d:IsOptimized="True"/>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step3SendMessage" d:IsOptimized="True"/>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step4ReceiveMessage" d:IsOptimized="True"/>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="ReceivedMessage">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="ReceiveMessageButton">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ColorAnimation Duration="0" To="#FF3399FF" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock3" d:IsOptimized="True"/>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Step5">
                    <Storyboard>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step1GetToken" d:IsOptimized="True"/>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step2CreateQueue" d:IsOptimized="True"/>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step3SendMessage" d:IsOptimized="True"/>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step4ReceiveMessage" d:IsOptimized="True"/>
                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Step5DeleteQueue" d:IsOptimized="True"/>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="QueueToDeleteName">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="DeleteQueueButton">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ColorAnimation Duration="0" To="#FF3399FF" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock4" d:IsOptimized="True"/>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <Border.Background>
    		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    			<GradientStop Color="#FF404040" Offset="0"/>
    			<GradientStop Color="#FF202020" Offset="0.3"/>
    		</LinearGradientBrush>
    	</Border.Background>
		<Border Padding="16" HorizontalAlignment="Center" VerticalAlignment="Center" CornerRadius="8" Background="#FFE0E0E0">
			<Border.Effect>
				<DropShadowEffect BlurRadius="32" ShadowDepth="0"/>
			</Border.Effect>
			<StackPanel Background="#FFE0E0E0">
				<StackPanel x:Name="Step1GetToken" Margin="0,0,0,8" Orientation="Horizontal" Background="White" Opacity="0.5">
					<TextBlock x:Name="textBlock" HorizontalAlignment="Left" TextWrapping="Wrap" d:LayoutOverrides="Height" Text="1" FontWeight="Bold" Margin="16" FontSize="32" FontFamily="Arial" Foreground="Gray" VerticalAlignment="Top"/>
					<StackPanel VerticalAlignment="Center" Margin="0,16">
						<TextBlock Margin="0" TextWrapping="Wrap" Text="Get a Token from ACS" VerticalAlignment="Top" d:LayoutOverrides="Width"/>
						<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Margin="16,4,16,0">
							<StackPanel Orientation="Vertical" Width="200">
								<TextBox x:Name="ServiceNamespace" TextWrapping="Wrap" Text="Service Namespace (eg: contoso)" Margin="0" IsEnabled="False"/>
								<TextBox x:Name="IssuerSecret" TextWrapping="Wrap" Text="Issuer Secret" Margin="0,8,0,0" IsEnabled="False"/>
							</StackPanel>
							<Button x:Name="GetTokenButton" Content="Get Token" Margin="8,0,0,0" Width="75" VerticalAlignment="Bottom" Height="24" IsEnabled="False" Click="GetTokenButtonClicked"/>
						</StackPanel>
					</StackPanel>
				</StackPanel>
				<StackPanel x:Name="Step2CreateQueue" Margin="0,8" Orientation="Horizontal" d:LayoutOverrides="Width" Background="White" Opacity="0.5">
					<TextBlock x:Name="textBlock1" HorizontalAlignment="Left" TextWrapping="Wrap" d:LayoutOverrides="Height" Text="2" FontWeight="Bold" Margin="16" FontSize="32" FontFamily="Arial" Foreground="Gray" VerticalAlignment="Top"/>
					<StackPanel VerticalAlignment="Center" Margin="0,16">
						<TextBlock Margin="0" TextWrapping="Wrap" Text="Create a Queue" VerticalAlignment="Top" d:LayoutOverrides="Width"/>
						<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Margin="16,4,16,0">
							<TextBox x:Name="NewQueueName" TextWrapping="Wrap" Text="MyTestQueue" Margin="0" Width="200" IsEnabled="False"/>
							<Button x:Name="CreateQueueButton" Content="Create" Margin="8,0,0,0" Width="75" Height="24" VerticalAlignment="Bottom" IsEnabled="False" Click="CreateQueueButtonClicked"/>
						</StackPanel>
					</StackPanel>
				</StackPanel>
				<StackPanel x:Name="Step3SendMessage" Margin="0,8" Orientation="Horizontal" Background="White" d:LayoutOverrides="Width" Opacity="0.5">
					<TextBlock x:Name="textBlock2" HorizontalAlignment="Left" TextWrapping="Wrap" d:LayoutOverrides="Height" Text="3" FontWeight="Bold" Margin="16" FontSize="32" FontFamily="Arial" Foreground="Gray" VerticalAlignment="Top"/>
					<StackPanel VerticalAlignment="Center" Margin="0,16">
						<TextBlock Margin="0" TextWrapping="Wrap" Text="Send a Message" VerticalAlignment="Top" d:LayoutOverrides="Width"/>
						<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Margin="16,4,16,0">
							<TextBox x:Name="MessageToSend" TextWrapping="Wrap" Text="Hello World!" Margin="0" Width="200" IsEnabled="False"/>
							<Button x:Name="SendMessageButton" Content="Send" Margin="8,0,0,0" Width="75" Height="24" VerticalAlignment="Bottom" IsEnabled="False" Click="SendMessageButtonClicked"/>
						</StackPanel>
					</StackPanel>
				</StackPanel>
				<StackPanel x:Name="Step4ReceiveMessage" Margin="0,8" Orientation="Horizontal" Background="White" d:LayoutOverrides="Width" Opacity="0.5">
					<TextBlock x:Name="textBlock3" HorizontalAlignment="Left" TextWrapping="Wrap" d:LayoutOverrides="Height" Text="4" FontWeight="Bold" Margin="16" FontSize="32" FontFamily="Arial" Foreground="Gray" VerticalAlignment="Top"/>
					<StackPanel VerticalAlignment="Center" Margin="0,16">
						<TextBlock Margin="0" TextWrapping="Wrap" Text="Receive the Message" VerticalAlignment="Top" d:LayoutOverrides="Width"/>
						<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Margin="16,4,16,0">
							<TextBox x:Name="ReceivedMessage" TextWrapping="Wrap" Margin="0" Width="200" IsReadOnly="True" IsEnabled="False"/>
							<Button x:Name="ReceiveMessageButton" Content="Receive" Margin="8,0,0,0" Width="75" Height="24" VerticalAlignment="Bottom" IsEnabled="False" Click="ReceiveMessageButtonClicked"/>
						</StackPanel>
					</StackPanel>
				</StackPanel>
				<StackPanel x:Name="Step5DeleteQueue" Margin="0,8,0,0" Orientation="Horizontal" Background="White" Opacity="0.5">
					<TextBlock x:Name="textBlock4" HorizontalAlignment="Left" TextWrapping="Wrap" d:LayoutOverrides="Height" Text="5" FontWeight="Bold" Margin="16" FontSize="32" FontFamily="Arial" Foreground="Gray" VerticalAlignment="Top"/>
					<StackPanel VerticalAlignment="Center" Margin="0,16">
						<TextBlock Margin="0" TextWrapping="Wrap" Text="Delete the Queue" VerticalAlignment="Top" d:LayoutOverrides="Width"/>
						<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Margin="16,4,16,0">
							<TextBox x:Name="QueueToDeleteName" TextWrapping="Wrap" Margin="0" Width="200" IsReadOnly="True" Text="{Binding Text, ElementName=NewQueueName}" IsEnabled="False"/>
							<Button x:Name="DeleteQueueButton" Content="Delete" Margin="8,0,0,0" Width="75" Height="24" VerticalAlignment="Bottom" IsEnabled="False" Click="DeleteQueueButtonClicked"/>
						</StackPanel>
					</StackPanel>
				</StackPanel>
        	</StackPanel>
		</Border>
    </Border>
</UserControl>
